/**
 * @file Base/Camera.hpp
 * @brief 相机设备框架
 * @note 一般情况无需从此处继承，请考虑从`RealtimeCamera`和`StorageCamera`处继承
 */

#ifndef CAMERA_BASE_OBJ_H
#define CAMERA_BASE_OBJ_H

#include "Config.hpp"
#include <functional>
#include <string>

class BaseCamera {
protected:
public:
  /**
   * @brief 相机类型
   */
  enum class CameraType { STORAGE, REALTIME };
  /**
   * @brief 图片类型
   */
  enum class ImageType { RGB8, GREY };
  /**
   * @class ImgInf
   * @brief 图片信息参数包
   *
   */
  struct ImgInf {
    int width;
    int height;
    ImageType type;
    long size;
  };
  /**
   * @brief 发送相机消息，用于通知上层函数
   */
  std::function<void(std::string inf)> funcCameraMessage;
  /**
   * @brief 掉线消息，用于通知上层函数
   */
  std::function<void()> funcOffline;
  /**
   * @brief 新图片消息，用于通知上层函数
   */
  std::function<void(long frameID, char *data, const std::string &additional)>
      funcNewImage;
  virtual std::string GetUUID() = 0;
  virtual bool ShotStatus() = 0;
  virtual BaseConfig *Config() = 0;
  virtual CameraType GetCameraType() = 0;
  virtual long MaxSingleImgSize() = 0;
  virtual float FPS() = 0;
};

#endif
